﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Product-Slider.ascx.cs" Inherits="Controls_Product_Slider" %>

<asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1">
    <HeaderTemplate>
        <div class="row">
            <div class="panel">
                <div class="panel-heading panel-icon3">
                    <h2 class="panel-title">Sản Phẩm Hot
                                    <div class="pull-right">
                                        <a href="#carousel-product-slider" class="btn btn-danger  " data-slide="prev">
                                            <span class="glyphicon glyphicon-chevron-left"></span></a>
                                        <a href="#carousel-product-slider" class="btn btn-danger  " data-slide="next">
                                            <span class="glyphicon glyphicon-chevron-right"></span>

                                        </a>
                                    </div>
                    </h2>
                </div>
            </div>
            <div id="carousel-product-slider" class="carousel slide " data-ride="carousel">
                <div class="carousel-inner">
                    <div class="item">
                        <div class="row">
    </HeaderTemplate>
    <ItemTemplate>
        <div class="col-xs-6 col-sm-4 col-md-4 ">
            <div class="col-item">
                <div class="photo-product">
                    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("MaSP", "../Product-Detail.aspx?masp={0}") %>'>
                        <asp:Image ID="Image2" runat="server" CssClass="img-responsive"
                            ImageUrl='<%# "~/"+Eval("Hinhanh") %>'
                            ToolTip='<%# Eval("TenSP") %>' />
                    </asp:HyperLink>
                </div>
                <div class="info">
                    <div class="row">
                        <div class="price col-md-12">
                            <h5>
                                <asp:HyperLink ID="HyperLink4" runat="server"
                                    NavigateUrl='<%# Eval("MaSP", "../Product-Detail.aspx?masp={0}") %>'
                                    Text='<%# Eval("TenSP") %>'></asp:HyperLink>
                            </h5>
                            <h5 class="price-text-color"><%#Eval("Gia","{0:0,00} ₫")%></h5>
                        </div>
                    </div>
                    <div class="separator">
                        <p class="btn-details">
                            <asp:HyperLink ID="MuaNgay" runat="server" NavigateUrl='<%# Eval("MaSP", "../Product-Detail.aspx?masp={0}") %>'><i class="glyphicon glyphicon-shopping-cart"></i>Mua Ngay</asp:HyperLink>
                        </p>
                    </div>

                </div>
            </div>
        </div>
    </ItemTemplate>
    <FooterTemplate>
        </div>
            </div>
        <asp:Repeater ID="Repeater2" runat="server" DataSourceID="SqlDataSource2">
            <HeaderTemplate>
                <div class="item">
                    <div class="row">
            </HeaderTemplate>
            <ItemTemplate>
                <div class="col-xs-6 col-sm-4 col-md-4 ">
                    <div class="col-item">
                        <div class="photo-product">
                            <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("MaSP", "../Product-Detail.aspx?masp={0}") %>'>
                                <asp:Image ID="Image2" runat="server" CssClass="img-responsive"
                                    ImageUrl='<%# "~/"+Eval("Hinhanh") %>'
                                    ToolTip='<%# Eval("TenSP") %>' />
                            </asp:HyperLink>
                        </div>
                        <div class="info">
                            <div class="row">
                                <div class="price col-md-12">
                                    <h5>
                                        <asp:HyperLink ID="HyperLink4" runat="server"
                                            NavigateUrl='<%# Eval("MaSP", "../Product-Detail.aspx?masp={0}") %>'
                                            Text='<%# Eval("TenSP") %>'></asp:HyperLink>
                                    </h5>
                                    <h5 class="price-text-color"><%#Eval("Gia")%>đ</h5>
                                </div>
                            </div>
                            <div class="separator">
                                <p class="btn-details">
                                    <asp:HyperLink ID="MuaNgay" runat="server" NavigateUrl='<%# Eval("MaSP", "../Product-Detail.aspx?masp={0}") %>'><i class="glyphicon glyphicon-shopping-cart"></i>Mua Ngay</asp:HyperLink>
                                </p>
                            </div>
                        </div>
                    </div>
                </div>
            </ItemTemplate>
            <FooterTemplate>
                </div>
        </div>
            </FooterTemplate>
        </asp:Repeater>
        </div>
            </div>
        </div>
    </FooterTemplate>
</asp:Repeater>

<asp:SqlDataSource ID="SqlDataSource1" runat="server"
    ConnectionString="<%$ ConnectionStrings:QLBSConnectionString %>"
    SelectCommand="SELECT top 3 * FROM [SanPham] order by Ngaynhap desc"></asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
    ConnectionString="<%$ ConnectionStrings:QLBSConnectionString %>"
    SelectCommand="SELECT TOP (3) * FROM SanPham WHERE (MaSP NOT IN (SELECT TOP (3) MaSP FROM SanPham AS SanPham_1 ORDER BY Ngaynhap DESC)) ORDER BY Ngaynhap DESC"></asp:SqlDataSource>
